package models;

import play.data.validation.Required;
import play.db.jpa.*;

import javax.persistence.*;

@Entity
@Table(name = "formations")
public class Formation extends Model {

    @Required
    public String name;
    @Required
    public Double price;
    @Required
    public String description;
    @Required
    public String duration;
    @ManyToOne
    @Required
    public FormationType formationtype;

    public Formation(String name, Double price, String description, String duration, FormationType formationtype) {
        this.name = name;
        this.price = price;
        this.description = description;
        this.duration = duration;
        this.formationtype = formationtype;
    }
}
